<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>10.流程控制-分支结构.总练习4</title>
    <script>
        //根据用户1~7，返回星期几
        var day = prompt('请输入1~7查询星期几');
        switch (day) {
            case '1':
                alert('星期一');
                break;
            case '2':
                alert('星期二');
                break;
            case '3':
                alert('星期三');
                break;
            case '4':
                alert('星期四');
                break;
            case '5':
                alert('星期五');
                break;
            case '6':
                alert('星期六');
                break;
            case '7':
                alert('星期日');
                break;
            default:
                alert('请输入1~7的数字');
        }
    </script>
</head>

<body>

</body>

</html